package org.gvsig.titleblock.swing.impl;

import org.gvsig.titleblock.ITBLocator;
import org.gvsig.titleblock.ITBManager;
import org.gvsig.titleblock.swing.IJOpenTBPanel;
import org.gvsig.titleblock.swing.IJSaveTBPanel;
import org.gvsig.titleblock.swing.ITBSwingManager;
import org.gvsig.tools.ToolsLocator;
import org.gvsig.tools.i18n.I18nManager;

/**
 * Implements the ITBSwingManager
 * @author Violeta
 *
 */
public class TBSwingManager implements ITBSwingManager {

    private ITBManager manager;
    private I18nManager i18nmanager = null;

    public TBSwingManager() {
        this.i18nmanager = ToolsLocator.getI18nManager();
        this.manager = ITBLocator.getManager();
    }

    /**
     * This method creates the saving panel
     */
	public IJSaveTBPanel createJSaveTBPanel(ITBManager block) {
        IJSaveTBPanel panel = new JSaveTBPanel(this, block);
        return panel;
    }
	
	/**
	 * This method creates the opening panel
	 */
	public IJOpenTBPanel createJOpenTBPanel(ITBManager block) {
        IJOpenTBPanel panel = new JOpenTBPanel(this, block);
        return panel;
    }

    public ITBManager getManager() {
        return this.manager;
    }

    public String getTranslation(String key) {
        return this.i18nmanager.getTranslation(key);
    }

}
